using System.Collections.Generic;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace E4RPDevExpress9
{
    public partial class LoadLayoutXtraForm : XtraForm
    {
        public List<string> Layouts
        {
            set { nameComboBoxEdit.Properties.Items.AddRange(value); }
        }

        public string LayoutName
        {
            get { return nameComboBoxEdit.Text; }    
        }

        public LoadLayoutXtraForm()
        {
            InitializeComponent();
            okSimpleButton.Click += OKSimpleButtonClick;
        }

        void OKSimpleButtonClick(object sender, System.EventArgs e)
        {
            dxErrorProvider.SetError(nameComboBoxEdit, "");
            if (nameComboBoxEdit.Text != "") return;
            dxErrorProvider.SetError(nameComboBoxEdit, "Por favor, seleccione o layout a carregar.");
            DialogResult = DialogResult.None;
        }
    }
}